/* 图表容器样式 */
.chart-container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
    padding: 24px;
    position: relative;
}

.chart {
    height: 500px;
    width: 100%;
}

/* 图表头部样式 */
.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.chart-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
    display: flex;
    align-items: center;
}

.chart-title i {
    margin-right: 8px;
    color: var(--primary-color);
}

.chart-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chart-filter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-select {
    padding: 6px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    background-color: #fff;
    min-width: 120px;
}

.action-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.3s;
}

.action-button:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.action-button i {
    font-size: 14px;
}

/* 图表描述样式 */
.chart-description {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 16px;
    padding: 12px;
    background-color: #f5f5f5;
    border-radius: 4px;
}

.chart-description i {
    color: var(--primary-color);
    margin-top: 3px;
}

.chart-description p {
    margin: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

/* 统计卡片样式 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.stats-card {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s;
}

.stats-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.stats-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
}

.stats-content {
    flex: 1;
}

.stats-title {
    font-size: 14px;
    color: #666;
    margin-bottom: 4px;
}

.stats-value {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
}

.stats-desc {
    font-size: 12px;
    color: #999;
}

/* 百分比条样式 */
.percentage-bar {
    position: relative;
    height: 20px;
    background-color: #f5f5f5;
    border-radius: 10px;
    overflow: hidden;
    width: 100%;
}

.percentage-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background-color: var(--primary-color);
    background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
    background-size: 1rem 1rem;
    transition: width 0.6s ease;
}

.percentage-text {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #333;
    font-size: 12px;
    font-weight: 500;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.8);
}

/* 加载状态 */
.loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 错误消息 */
.error-message {
    background-color: #fff2f0;
    border: 1px solid #ffccc7;
    color: #ff4d4f;
    padding: 16px;
    border-radius: 4px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 页面标题 */
.page-title {
    margin-bottom: 24px;
    color: var(--text-color);
    font-size: 24px;
    font-weight: 600;
    position: relative;
    padding-left: 16px;
}

.page-title:before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .main-content {
        padding: 20px;
    }

    .chart {
        height: 450px;
    }
}

@media (max-width: 992px) {
    .sidebar {
        width: 180px;
    }

    .main-content {
        margin-left: 180px;
    }

    .chart {
        height: 400px;
    }

    .chart-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .chart-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 64px;
    }

    .nav-item {
        padding: 16px 0;
        justify-content: center;
    }

    .nav-item i {
        margin-right: 0;
    }

    .nav-item span {
        display: none;
    }

    .main-content {
        margin-left: 64px;
        padding: 16px;
    }

    .chart {
        height: 350px;
    }

    .chart-actions {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    .chart-filter {
        width: 100%;
    }

    .filter-select {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .header {
        padding: 0 16px;
    }

    .logo {
        height: 32px;
    }

    .system-title {
        font-size: 1rem;
    }

    .chart {
        height: 300px;
    }

    .chart-container {
        padding: 16px;
    }

    .page-title {
        font-size: 20px;
    }

    .action-button span {
        display: none;
    }

    .action-button {
        padding: 8px;
    }
}

/* 打印样式 */
@media print {
    .header,
    .sidebar {
        display: none;
    }

    .main-content {
        margin: 0;
        padding: 0;
    }

    .chart-container {
        box-shadow: none;
        break-inside: avoid;
    }

    .chart-actions {
        display: none;
    }
}
